<?php
$val1= ($_REQUEST['val1']!="null" && $_REQUEST['val1']!="" )?explode(",",$_REQUEST['val1']):"";
$val2=($_REQUEST['val2']!="null" && $_REQUEST['val2']!="")?explode(",",$_REQUEST['val2']):"";
$val3=$_REQUEST['val3'];
if(($val1!="")&&($val2!=""))
{
	foreach ($val1 as $va)
	{
		if (in_array($va, $val2))
		{
	   		$arr[]="yes";
		}
		else
		{
			$arr[]="false";
		}
		
	}
	if(in_array("yes",$arr)||$val3=="N")
	{
		echo "true";
	
	}
	else
	{
        echo "false";
		
	}
}
else if(($val1=="")&&($val2==""))
{
    if($val3=="N")
        {
        echo "false";
		
        }
        else
        {
            echo "true";
			
			
        }
}else if(($val1=="")||($val2=="")){
    if($val3!="N")
        {
        echo "false";
        }
        else
        {
            echo "true";
        }
}
?>